import React, { Component } from 'react'
import { HashRouter as Router, Route, Switch } from 'react-router-dom'
import App from './App'
import Login from './pages/login'
import Admin from './pages/admin'
import Buttons from './pages/ui/buttons'
import Modals from './pages/ui/modals'
import NoMatch from './pages/nomatch'

class IRouter extends Component {
    render() {
        return (
            <Router>
                <App>
                <Switch>
                    <Route path="/login" component={Login} />
                    <Route path="/admin" render={() =>
                        <Admin>
                          
                            <Route path="/admin/ui/buttons" component={Buttons} />
                            <Route path="/admin/ui/modals" component={Modals} />
                            
                        </Admin>
                    } />
                    <Route  component={NoMatch} />
                    </Switch>
                </App>
            </Router>
        )
    }
}
export default IRouter;